package com.lai.note.activity;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.os.Bundle;
import android.view.View;

import com.lai.note.R;
import com.lai.note.adapter.WenanRecyclerAdapter;
import com.lai.note.model.Wenan;
import com.lai.note.util.ListWenanUtil;

import java.util.ArrayList;
import java.util.List;

public class RecordsWenanActivity extends AppCompatActivity {
    private RecyclerView recyclerView;
    private WenanRecyclerAdapter adapter;
    private LinearLayoutManager layoutManager;
    private List<Wenan> wenans = new ArrayList<Wenan>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        System.out.println("进来了onCreate");
        super.onCreate(savedInstanceState);
        setContentView(R.layout.listwenan_recyclerview);
        initViews();
        initDatas();
    }



    private void initViews(){
        recyclerView = findViewById(R.id.wenan_recyclerview);
        adapter = new WenanRecyclerAdapter(wenans);
        layoutManager = new LinearLayoutManager(this);
        recyclerView.setLayoutManager(layoutManager);
        recyclerView.setAdapter(adapter);
    }

    private void initDatas(){
        ListWenanUtil.initDatas(this,adapter);
    }
}
